home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / diskmags / 5791-.end / dmg-6260 / articles / psg6.doc < prev    next >
Text File  |  1993-06-26  |  2KB  |  41 lines

  1.                PROGRAMMABLE SOUND GENERATOR REGISTER 6
  2.               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  3.  
  4. As you may already know,  there  are  14  different PSG registers which
  5. control the music or sound effects  that the YM2149 chip generates. One
  6. use for three of these registers  is  for the ever-famous VU meters (8,
  7. 9, and 10). After a little bit  of research and experimentation, I have
  8. come across something which may  interest  people who want different VU
  9. meters.
  10.  
  11. The register that I am talking about  is number 6; the noise generator.
  12. This is used by the  musicians  to  produce  the  drum effects in their
  13. music.
  14.  
  15. By reading PSG(6) while music  is  playing,  you  are able to determine
  16. what percussion instrument is playing at  any given time. First of all,
  17. however, you need to find out which value each different drum has.
  18.  
  19. This program shows what I mean:
  20.  
  21. 10 dreg(0)=1 : call 3 : loke $4d2,start(3)+8
  22. 15 rem                    Assumes you have MAD MAX music in bank 3
  23. 20 repeat
  24. 30 print PSG(6)
  25. 40 h=hardkey
  26. 50 until h=57
  27. 60 loke $4d2,0 : silence
  28.  
  29. This should produce a continuous list  of numbers, mostly 0's, but some
  30. 12's or 7's or 14's. These other numbers are printed whenever the noise
  31. generator is called.
  32.  
  33. So, by watching which number  is  produced  whenever a drum sounds, you
  34. can note it's value,  and  use  it  later  on. Unfortunately, different
  35. pieces of music use different values  for  each  drum, so the values of
  36. PSG(6) are unique to each demo.
  37.  
  38. Load up PSG6.BAS and you will see what can be done with this function.
  39.  
  40. Article: BLACK EAGLE 26/6/93
  41.